<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="icms.ORM.PhotoPanel" %>
<%@ page import="icms.service.PhotoPanelService" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>articlePanelMan</title>
<script type="text/javascript">
function showphoto(cimg,obj)
{　
    var mytop=obj.offsetTop; 
　　var myleft=obj.offsetLeft;
　　while(obj=obj.offsetParent){
    　　myleft+=obj.offsetLeft; 
    　　mytop+=obj.offsetTop; 
　　}
	var photodiv = document.getElementById("photodiv");
    photodiv.style.top=mytop-30;
    photodiv.style.left=myleft+60;
photodiv.innerHTML="<img src='"+  cimg +"' width=180 height=240 border=0>";
photodiv.style.visibility='visible';
}
//图片关闭
function closephoto()
{
	var photodiv = document.getElementById("photodiv");
	photodiv.style.visibility='hidden';
} 
</script>
</head>
 <body>
<table width="100%" height="100%" border="0">
<tr height="100%">
<td width="180px" valign="top"><div id="photodiv" style="visibility:hidden;" ></div></td>
<td valign="top">
	<table width="80%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
		<tr bgcolor="#E7E7E7">
			<td height="24" colspan="5" background="skin/images/tbg.gif">&nbsp;图片列表&nbsp;</td>
		</tr>
		<tr align="center" bgcolor="#FAFAF1" height="22">
			<td width="10%">序号</td>
			<td width="30%">名称</td>
			<td width="30%">链接地址</td>
			<td width="10%">状态</td>
			<td width="20%">操作</td>
		</tr>
<%
	PhotoPanel photo=new PhotoPanel();
	int photoID;
	PhotoPanelService service=new PhotoPanelService();
	List photolList=service.getAllPhotos();
	for(int i=0;i<photolList.size();i++){
		photo=(PhotoPanel)photolList.get(i);
		photoID=photo.getPhotoID();
		String deleteUrl="href=\"deletePhoto.jsp?id="+photoID+"\"";
		String editUrl="href=\"editPhoto.jsp?id="+photoID+"\"";
%>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
	<td><%= photo.getPhotoSequence() %></td>
	<td><a href="#" onMouseOver="javascript:showphoto('../<%= photo.getPhotoPath() %>',this)" onMouseOut="javascript:closephoto()"><%= photo.getPhotoName() %></a></td>
	<td><%= photo.getPhotoLink() %></td>
	<td>
	<%
		if(photo.getPhotoDisplay()==0){
			out.write("禁用");
		}else{
			out.write("启用");
		}
	 %>
	</td>
	<td>
		<a onclick="return confirm('删除？')" <%= deleteUrl %> >删除</a>
		<a <%= editUrl %> >编辑</a>
	</td>
</tr>
<%
	}
 %>
	</table>

</td>
</tr>
</table>
</body>
</html>